sortlistmodel: Use timsort
authorBenjamin Otte <otte@redhat.com>
Fri, 17 Jul 2020 00:47:22 +0000 (02:47 +0200)
committerBenjamin Otte <otte@redhat.com>
Wed, 22 Jul 2020 12:04:40 +0000 (14:04 +0200)
commit800170b47dfede5e9de300eaed630ddebd5c27de
tree614cba33ef87ea89072dc9da64fd62cee951d63a
parent97c5cb3514aeb3279dcf4c4170277303deee04fb
sortlistmodel: Use timsort

Simply replace the old qsort() call with a timsort() call.

This is ultimately relevant because timsort is a LOT faster in merging
to already sorted lists (think items-chaged adding some items) or
reversing an existing list (think columnview sort order changes).

Benchmarks:

    initially sorting the model
                    qsort  timsort
    128,000 items   124ms    111ms
    256,000 items   264ms    250ms
gtk/gtksortlistmodel.c